<template>

   <div class="header">
      <a href="#" class="logo"></a>
      <div class="search" @click="toSearch">
        <van-icon name="search" />
        <span class="ipt">搜索商品,共11111件商品</span>
      </div>
      <button class="loginbtn">登录</button>
    </div>
  
</template>
<script lang="ts">
import { useRouter } from 'vue-router';
export default {
  name: "HxmHeader",
};
</script>
<script setup lang="ts">
const $router = useRouter();
const toSearch = () => {
  $router.push({ name: "search" });
};
</script>

<style scoped>
.header {
  width: 375px;
  height: 44px;
  display: flex;
  box-sizing: border-box;
  padding: 8px 15px;
  align-items: center;
  background: #fff;
}
.logo {
  display: inline-block;
  vertical-align: middle;
  width: 69px;
  height: 20px;
  background: url(../../assets/images/logo.png);
  background-size: 188px 188px;
  background-position: -63px -167px;
  margin-right: 10px;
}
.search {
  flex: 1;
  flex-grow: 1;
  display: flex;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  border: 1px solid #ccc;
  background: #ededed;
}
.search .ipt {
  font-size: 16px;
  color: #666;
}

:deep().van-icon-search {
  font-size: 16px;
}
.loginbtn {
  width: 37px;
  height: 20px;
  font-size: 12px;
  margin-left: 10px;
  line-height: 20px;
  border: 1px solid #dd1a21;
  color: #dd1a21;
  border-radius: 3px;
}

</style>